<template>
  <div class="app-container">
    <el-form ref="queryFormRef" :inline="true" :model="queryParams" class="demo-form-inline"
      v-hasPermi="['md:project:query']">
      <el-form-item label="财年" prop="year">
        <el-date-picker v-model="queryParams.year" type="year" value-format="yyyy" placeholder="请选择财年" size="small">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="省份" prop="province">
        <el-select v-model="queryParams.province" size="small" clearable filterable placeholder="请选择省份"
          style="width: 100%;">
          <el-option v-for="item in provinceList" :key="item.code" :label="item.name" :value="item.name">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="项目编号" prop="projectNo">
        <el-input v-model.trim="queryParams.projectNo" clearable size="small" :max="50"
          placeholder="请输入项目编号"></el-input>
      </el-form-item>
      <el-form-item label="项目名称" prop="name">
        <el-input v-model.trim="queryParams.name" size="small" :max="50" placeholder="请输入项目名称"></el-input>
      </el-form-item>
      <el-form-item label="客户/代理商" prop="type">
        <el-select v-model="queryParams.type" size="small" clearable filterable placeholder="请选择客户/代理商"
          style="width: 100%;">
          <el-option v-for="item in projectType" :key="item.value" :label="item.label" :value="item.value">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="客户" prop="clientName">
        <el-input v-model.trim="queryParams.clientName" size="small" :max="50" placeholder="请输入客户"></el-input>
      </el-form-item>
      <el-form-item label="代理商" prop="agentName">
        <el-input v-model.trim="queryParams.agentName" size="small" :max="50" placeholder="请输入代理商"></el-input>
      </el-form-item>
      <el-form-item label="所属公司" prop="belongCompany">
        <el-select v-model="queryParams.belongCompany" filterable clearable default-first-option placeholder="请选择所属公司"
                   style="width: 100%">
          <el-option v-for="item in belongCompany" :key="item.id" :label="item.name" :value="item.name">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="合同签订日期" prop="visitDate">
        <el-date-picker v-model="projectDate" type="daterange" value-format="yyyy-MM-dd" range-separator="至"
          start-placeholder="开始日期" end-placeholder="结束日期" size="small">
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" v-hasPermi="['md:project:query']"
          @click="searchHandler">查询</el-button>
        <el-button icon="el-icon-refresh-right" size="mini" v-hasPermi="['md:project:query']"
          @click="resetHandler">重置</el-button>
      </el-form-item>
    </el-form>

    <el-table ref="tableRef" :data="tableData" v-loading="loading" highlight-current-row max-height="600"
      v-horizontal-scroll="'auto'" style="width: 100%;margin-top: 10px;" @current-change="handleCurrentChange">
      <el-table-column type="index" width="50" align="center" label="序号">
        <template slot-scope="scope">
          <span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
        </template>
      </el-table-column>
      <el-table-column property="projectNo" label="项目编号" align="center" width="140" />
      <el-table-column property="year" label="财年" align="center" width="80" />
      <el-table-column property="name" label="项目名称" align="center" min-width="180" />
      <el-table-column property="belongCompany" label="所属公司" align="center" width="160" />
      <el-table-column property="signDate" label="合同签订日期" align="center" width="140" />
      <el-table-column property="bidAmount" label="合同金额(万元)" align="center" width="110" />
      <el-table-column property="deliveryDate" label="交付日期" align="center" width="100" />
      <el-table-column property="guaranteeDate" label="质保日期" align="center" width="100" />
      <el-table-column property="province" label="省份" align="center" width="120" />
      <!-- <el-table-column
        property="clientName"
        label="客户"
        align="center"
        width="200"
      />
      <el-table-column
        property="agentName"
        label="代理商"
        align="center"
        width="200"
      /> -->
      <el-table-column label="客户/代理商" align="center" min-width="160">
        <template slot-scope="scope">
          <span v-if="scope.row.clientName && scope.row.clientName.length > 0">
            {{ scope.row.clientName }}
          </span>
          <span v-else>{{ scope.row.agentName }}</span>
        </template>
      </el-table-column>
      <el-table-column property="facultyName" label="二级部门" align="center" width="200" />
      <el-table-column property="contactName" label="联系人" align="center" width="120" />
      <el-table-column property="contactJob" label="职务" align="center" width="120" />
      <el-table-column property="contactPhone" label="手机号码" align="center" width="120" />
      <el-table-column property="decisionName" label="决策人" align="center" width="120" />
      <el-table-column property="decisionJob" label="职务" align="center" width="120" />
      <el-table-column property="decisionPhone" label="手机号码" align="center" width="120" />
    </el-table>

    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />

    <div>
      <el-tabs>
        <el-tab-pane label="详细信息" v-if="$auth.hasPermi('md:project:device:list')">
          <Device v-if="projectInfo.id" :project-info="projectInfo" :type="0" />
        </el-tab-pane>
        <el-tab-pane label="开票信息" v-if="$auth.hasPermi('md:project:invoice:list')">
          <ProjectInvoice v-if="projectInfo.id" :project-info="projectInfo" :type="0" />
        </el-tab-pane>
        <el-tab-pane label="回款信息" v-if="$auth.hasPermi('md:project:payment:list')">
          <Payment v-if="projectInfo.id" :project-info="projectInfo" :type="0" />
        </el-tab-pane>
        <el-tab-pane label="项目进度" v-if="$auth.hasPermi('sa:schedule:list')">
          <Order v-if="projectInfo.id" :project-info="projectInfo" :type="0" />
        </el-tab-pane>
      </el-tabs>
    </div>

    <el-dialog :title="dialogTitle === 1 ? '新增' : '修改'" :visible.sync="dialogVisible" width="50%"
      :close-on-click-modal="false">
      <el-form :model="form" :rules="rules" ref="formRef" label-width="100px" class="demo-form">
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="名称" prop="name">
              <el-input v-model.trim="form.name" placeholder="请输入名称"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="预算金额" prop="amount">
              <el-input v-model.trim="form.amount" type="number" :min="0" placeholder="请输入预算金额" @input="inputHandler">
                <template slot="append">万元</template>
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="客户" prop="clientName">
              <el-select v-model="form.clientName" filterable clearable default-first-option placeholder="请选择客户"
                style="width: 100%" @change="changeCustomerHandler">
                <el-option v-for="item in customerList" :key="item.id" :label="item.name" :value="item.name">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="二级部门" prop="facultyName">
              <el-select v-model="form.facultyName" filterable clearable default-first-option placeholder="请选择二级部门"
                style="width: 100%" @change="changeSchoolHandler">
                <el-option v-for="item in schoolList" :key="item.id" :label="item.name" :value="item.name">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="联系人" prop="contactId">
              <el-select v-model="form.contactId" filterable clearable default-first-option placeholder="请选择联系人"
                style="width: 100%" @change="changeContactHandler">
                <el-option v-for="item in contactList" :key="item.id" :label="item.name" :value="item.id">
                </el-option>
              </el-select>
              <el-checkbox v-model="form.isDecision" @change="checkboxChangeHandler">是否决策人</el-checkbox>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="联系人职务" prop="contactJob">
              <el-input v-model.trim="form.contactJob" disabled placeholder="联系人职务" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="联系人手机号" prop="contactPhone">
              <el-input v-model.trim="form.contactPhone" disabled placeholder="联系人手机号" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="决策人" prop="decisionId">
              <el-select v-model="form.decisionId" filterable clearable default-first-option placeholder="请选择决策人"
                style="width: 100%" @change="changeDecisionHandler">
                <el-option v-for="item in contactList" :key="item.id" :label="item.name" :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="决策人职务" prop="decisionJob">
              <el-input v-model.trim="form.decisionJob" disabled placeholder="决策人职务" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="决策人手机号" prop="decisionPhone">
              <el-input v-model.trim="form.decisionPhone" disabled placeholder="决策人手机号" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="进度" prop="schedule">
              <el-select v-model="form.schedule" clearable filterable placeholder="请选择进度" style="width: 100%;">
                <el-option v-for="item in dict.type.sys_project_schedule" :key="+item.value" :label="item.label"
                  :value="+item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="进度日期" prop="nowDate">
              <el-date-picker v-model="form.nowDate" type="date" :picker-options="pickerOptions" placeholder="选择日期"
                value-format="yyyy-MM-dd" style="width: 100%;" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="中标金额" v-if="form.schedule === 6" prop="bidAmount">
              <el-input v-model.trim="form.bidAmount" type="number" :min="0" placeholder="请输入中标金额"
                @input="inputOtherHandler">
                <template slot="append">万元</template>
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12"></el-col>
        </el-row>
        <el-form-item label="代理商" prop="agentId">
          <el-select v-model="form.agentId" filterable clearable default-first-option placeholder="请选择代理商"
            style="width: 100%">
            <el-option v-for="item in agentList" :key="item.id" :label="item.name" :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model.trim="form.remark" type="textarea" :maxlength="200" placeholder="请输入备注"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm('formRef')">提交</el-button>
        <el-button @click="dialogVisible = false">取消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  addDataApi,
  checkProjectNameUniqueApi,
  deleteDataApi,
  getDataListApi,
  updateDataApi
} from "@/api/crm/md/project";
import { getDataListApi as getAllCustomerListApi } from "@/api/crm/md/customer";
import { getDataListApi as getAllContactListApi } from "@/api/crm/md/contacts";
import { getDataListApi as getAllSchoolListApi } from "@/api/crm/md/school";
import { getDataListApi as getAllAgentListApi } from "@/api/crm/md/agent";
import { addDataApi as addProjectProcessApi } from "@/api/crm/sa/order"
import ProvinceData from '@/views/crm/data/province.json'
import { getUserProfile } from "@/api/system/user";
import Device from './components/device.vue';
import Order from './components/order.vue';
import Payment from '@/views/crm/sa/payment/index.vue'
import ProjectInvoice from "./components/invoice.vue";
// import {isNumberStr} from "@/utils";

export default {
  name: 'ProjectProcessView',
  components: { ProjectInvoice, Device, Order, Payment },
  dicts: ['sys_key_customer_basis', 'sys_project_schedule'],
  data() {
    return {
      currentAmount: 0, // 当前预算金额
      allAmount: 0, // 总预算金额
      currentBidAmount: 0, // 当前中标金额
      allBidAmount: 0, // 当前中标金额 bidAmount
      // 日期选择框设置不能选今日之后的日期
      pickerOptions: {
        disabledDate(time) {
          // 禁止选择今天及今天之后的日期
          return time.getTime() > Date.now();
        }
      },
      // 项目日期
      projectDate: [],
      // 加载动画
      loading: true,
      // 代理商数据
      agentList: [],
      // 客户数据
      customerList: [],
      // 二级部门数据
      schoolList: [],
      // 联系人数据
      contactList: [],
      // 项目信息
      projectInfo: {
        id: null,
      },
      belongCompany: [], // 所属公司
      // 省份数据
      provinceList: [],
      // 弹框标题 1是增加 其他是修改
      dialogTitle: 1,
      // 弹框显示
      dialogVisible: false,
      // 新增和修改参数
      form: {
        bidAmount: 0, // 中标金额
        agentId: null, // 代理商id
        agentName: "", // 代理商名称
        clientName: "", // 客户名称
        contactId: null, // 联系人id *
        contactJob: "", // 联系人职务
        contactPhone: "", // 联系人手机号
        createTime: "", // 创建时间
        decisionId: null, // 决策人id *
        endDate: "", // 开始时间
        facultyName: "", // 二级部门名称
        nowDate: "", // 项目日期 *
        schedule: 1, // 项目进度 *
        startDate: "", // 开始时间
        updateTime: "", // 更新时间
        isDecision: false, // 是否项目决策人
        address: "", // 地址
        amount: "", // 金额 *
        basis: null, // 重点依据
        decisionJob: "", // 决策人职务
        decisionPhone: "", // 决策人手机号
        createBy: "", // 用户 *
        contactName: "", // 联系人
        id: null, // id
        isImportant: 0, // 是否重点客户 0是普通 1是重点 *
        name: "", // 学校名 *
        province: "", // 省份 *
        remark: "", // 备注
        updateBy: "", // 更新人
      },
      // 重点客户下拉数据
      isImportantList: [
        {
          value: 0,
          label: '普通客户'
        },
        {
          value: 1,
          label: '重点客户'
        }
      ],
      // 项目来源类型
      projectType: [
        {
          value: "客户",
          label: "客户"
        },
        {
          value: "代理商",
          label: "代理商"
        }
      ],
      // 表单的校验规则
      rules: {
        bidAmount: [
          { required: true, message: '请填写中标金额', trigger: 'blur' }
        ],
        amount: [
          { required: true, message: '请填写预算金额', trigger: 'blur' }
        ],
        name: [
          { required: true, message: '请填写客户', trigger: 'blur' }
        ],
        clientName: [
          { required: true, message: '请选择客户', trigger: 'change' }
        ],
        facultyName: [
          { required: true, message: '请选择二级部门', trigger: 'change' }
        ],
        nowDate: [
          { required: true, message: '请选择日期', trigger: 'blur' }
        ],
        schedule: [
          { required: true, message: '请选择进度', trigger: 'change' }
        ],
        contactId: [
          { required: true, message: '请选择联系人', trigger: 'change' }
        ],
        decisionId: [
          { required: true, message: '请选择决策人', trigger: 'change' }
        ],
      },
      // 表格数据
      tableData: [],
      // 总数条数
      total: 0,
      // 查询参数
      queryParams: {
        belongCompany: "", // 所属公司
        type: "", // 项目来源的类型
        projectNo: "", // 项目编号
        year: "", // 财年
        name: "", // 项目名称 *
        startDate: "", // 开始时间
        endDate: "", // 开始时间
        contactName: "", // 联系人
        clientName: "", // 客户名称
        agentName: "", // 代理商名称
        schedule: null, // 项目进度 *
        flag: true, // true是已完成项目 false反之
        pageNum: 1,
        pageSize: 10,
      },
      // 用户信息
      user: {},
      roleGroup: {},
      postGroup: {},
    }
  },
  watch: {
    projectDate: {
      handler(newV) {
        if (newV) {
          this.queryParams.startDate = newV[0] ?? ''
          this.queryParams.endDate = newV[1] ?? ''
        } else {
          this.queryParams.startDate = ''
          this.queryParams.endDate = ''
        }
      },
    },
    'form.isImportant': {
      handler(newV) {
        if (newV !== 1) {
          this.form.basis = null
        }
      }
    },
  },
  created() {
    this.provinceList = ProvinceData
    this.getList()
    this.getUserinfo()
    this.getAllCustomerList()
    this.getAllAgentList()
  },
  methods: {
    // 是否项目决策人选择框的回调
    checkboxChangeHandler(val) {
      if (val) {
        this.form.decisionId = this.form.contactId
        this.form.decisionJob = this.form.contactJob
        this.form.decisionPhone = this.form.contactPhone
      }
    },
    // 用户输入的回调
    inputHandler(e) {
      if (+e < 0) this.form.amount = 0
    },
    // 用户输入中标金额的回调
    inputOtherHandler(e) {
      if (+e < 0) this.form.bidAmount = 0
    },
    // 获取全部代理商数据
    getAllAgentList() {
      getAllAgentListApi().then((res) => {
        this.agentList = res.rows ?? []
      })
    },
    // 选中当前列
    handleCurrentChange(row) {
      this.projectInfo = { ...row }
    },
    // 改变联系人的回调
    // 根据联系人姓名 在联系人信息表中查询 找到职务、手机号
    changeContactHandler(val) {
      let result = null
      this.contactList.map((item) => {
        if (item.id === val) result = { ...item }
      })

      if (result) {
        this.form.contactJob = result.job
        this.form.contactPhone = result.phone
      }
    },
    changeDecisionHandler(val) {
      let result = null
      this.contactList.map((item) => {
        if (item.id === val) result = { ...item }
      })

      if (result) {
        this.form.decisionJob = result.job
        this.form.decisionPhone = result.phone
      }
    },
    // 获取全部客户信息
    getAllCustomerList() {
      getAllCustomerListApi().then((res) => {
        this.customerList = (res.rows ?? []).filter(i => i.clientType !== '博诺集团')
        this.belongCompany = (res.rows ?? []).filter(i => i.clientType === '博诺集团')
      })
    },
    // 获取全部二级部门信息
    async getAllSchoolList(clientName) {
      const res = await getAllSchoolListApi({ clientName })
      this.schoolList = res.rows ?? []
    },
    // 改变二级部门的回调
    changeSchoolHandler(val) {
      this.cleanContectInfo()
      this.getAllContactList(val)
    },
    // 获取全部联系人信息
    async getAllContactList(val) {
      const payload = {
        faculty: val,
        type: 0,
      }
      const res = await getAllContactListApi(payload)
      this.contactList = res.rows ?? []
    },
    // 改变客户的回调
    changeCustomerHandler(val) {
      this.form.facultyName = ""
      this.cleanContectInfo()
      this.getAllSchoolList(val)
    },
    // 清空联系人相关信息
    cleanContectInfo() {
      this.form.contactName = ""
      this.form.contactJob = ""
      this.form.contactPhone = ""
      this.form.decisionJob = ""
      this.form.decisionPhone = ""
      this.form.decisionId = null
      this.form.contactId = null
      this.form.isDecision = false
    },
    // 选择重点的回调
    changePropertyHandler(val) {
      if (val === 0) {
        this.form.basis = null
      }
    },
    // 获取根据list中的value返回label
    getListValue(data, list, value = 'value') {
      let label = ''
      list.map((item) => {
        if (+item[value] === +data) {
          label = item.label
        }
      })
      return label
    },
    // 获取用户信息
    getUserinfo() {
      getUserProfile().then(response => {
        this.user = response.data;
        this.roleGroup = response.roleGroup;
        this.postGroup = response.postGroup;
      });
    },
    // 获取数据
    async getList() {
      this.loading = true
      const { code, data } = await getDataListApi(this.queryParams)
      if (code === 200) {
        this.tableData = data?.list?.rows ?? []
        this.total = data?.list?.total ?? 0

        this.allAmount = data?.amount ?? 0
        this.allBidAmount = data?.bidAmount ?? 0

        this.currentAmount = this.tableData.reduce((acc, cur) => acc + (cur.amount ?? 0), 0)
        this.currentBidAmount = this.tableData.reduce((acc, cur) => acc + (cur.bidAmount ?? 0), 0)
      }
      this.loading = false
    },
    // 搜索的回调
    searchHandler() {
      this.queryParams.pageNum = 1
      this.getList()
    },
    // 删除的回调
    async deleteHandler(row) {
      const res = await deleteDataApi({
        id: row.id
      })
      if (res.code === 200) {
        this.$message({
          message: res.msg,
          type: 'success'
        });
        this.getList()
        this.dialogVisible = false
      } else {
        this.$message({
          message: res.msg,
          type: 'error'
        });
      }
    },
    // 打开弹窗
    openDialog(row) {
      if (row) {
        this.form = {
          ...row,
          isDecision: row.contactId === row.decisionId,
          oldSchedule: row.schedule
        }
        this.getAllSchoolList(this.form.clientName)
        this.getAllContactList(this.form.facultyName)
        this.dialogTitle = 2
      } else {
        this.schoolList.length = 0
        this.contactList.length = 0
        this.form = { ...this.$options.data().form }
        this.dialogTitle = 1
      }
      this.dialogVisible = true
      this.resetForm('formRef')
    },
    // 导出的回调
    async exportHandler() {
      this.download('crm/project/export', {
        ...this.queryParams,
        userId: this.user.userId,
        deptId: this.user.deptId,
      }, `projects_${new Date().getTime()}.xlsx`)
    },
    // 表单提交
    submitForm(formName) {
      if (this.form.isImportant === 1 && !(this.form.basis)) {
        this.$notify({
          title: '警告',
          message: '请选择重点依据',
          type: 'warning'
        });
        return false
      }
      this.$refs[formName].validate((valid) => {
        if (valid) {
          if (this.dialogTitle === 1) {
            // 先查询项目是否存在
            this.selProject()
            // this.addDataHandler()
          } else {
            this.updateDataHandler()
          }
        } else {
          console.log('error submit!!');
          return false;
        }
      });
    },
    async selProject() {
      const self = this
      const res = await checkProjectNameUniqueApi(this.form)
      if (res.data) {
        this.$confirm('确定继续增加？', '项目已经存在', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning',
        }).then(() => {
          self.addDataHandler()
        }).catch(() => { })
      } else {
        await this.addDataHandler()
      }
    },
    async addProjectProcess(data) {
      const payload = {
        createBy: data.createBy,
        updateBy: data.updateBy,
        nowDate: data.nowDate, // 日期 *
        projectFundId: data.id, // 项目id *
        remark: data.remark, // 备注
        schedule: data.schedule, // 进度 *
        userId: this.user.userId,
      }
      await addProjectProcessApi(payload)
    },
    // 增加数据的回调
    async addDataHandler() {
      const payload = {
        ...this.form,
        createBy: this.user.nickName,
        updateBy: this.user.nickName,
        userId: this.user.userId,
      }
      const res = await addDataApi(payload)
      if (res.code === 200) {
        this.$message({
          message: res.msg,
          type: 'success'
        });
        // 增加一条项目跟单
        this.addProjectProcess({
          ...payload,
          id: res.data
        })
        this.getList()
        this.dialogVisible = false
      } else {
        this.$message({
          message: res.msg,
          type: 'error'
        });
      }
    },
    // 修改数据的回调
    async updateDataHandler() {
      const payload = {
        ...this.form,
        updateBy: this.user.nickName,
      }
      const res = await updateDataApi(payload)
      if (res.code === 200) {
        this.$message({
          message: res.msg,
          type: 'success'
        });
        if (payload.schedule !== payload.oldSchedule) {
          this.addProjectProcess(payload)
        }
        this.getList()
        this.dialogVisible = false
      } else {
        this.$message({
          message: res.msg,
          type: 'error'
        });
      }
    },
    // 重置表单
    resetForm(formName) {
      if (this.$refs[formName]) {
        this.$refs[formName].resetFields();
      }
    },
    // 重置的回调
    resetHandler() {
      this.projectDate = []
      this.resetForm('queryFormRef')
    },
  },
}
</script>

<style scoped lang="scss">
.grid-content.text {
  margin-top: 10px;
  color: red;
}
</style>
